package com.briup.sms.web.controller;

import com.briup.sms.service.IndexService;
import com.briup.sms.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/index")
@Api("首页数据管理")

public class IndexController {
    @Autowired
    IndexService service;

    @GetMapping("/dashboard")
    @ApiOperation("首页仪表盘数据")
    public Result dashboard(){
        Map<String, Integer> map = service.dashboard();
        return  Result.success(map);
    }
}
